package vy.org.app.page.satsang;

import org.vy.dal.dao.VySatsangDO;

public class MntnSatsangAssembler {

	private static MntnSatsangAssembler assembler = new MntnSatsangAssembler();

	public static MntnSatsangAssembler getAssembler() {
		return assembler;
	}

	public VySatsangDO getSatsangDO(MntnSatsangForm form) {
		VySatsangDO dto = new VySatsangDO();

		if (form.getSatsangId() != null
				&& !"".equals(form.getSatsangId().trim())) {
			dto.setSatsangId(form.getSatsangId());
		}
		if (form.getRefId() != null && !"".equals(form.getRefId().trim())) {
			dto.setRefId(form.getRefId());
		}
		if (form.getSatsangAddress() != null
				&& !"".equals(form.getSatsangAddress().trim())) {
			dto.setSatsangAddress(Integer.parseInt(form.getSatsangAddress()));
		}
		if (form.getPrimaryContactVyId() != null
				&& !"".equals(form.getPrimaryContactVyId().trim())) {
			dto.setPrimaryContactVyId(form.getPrimaryContactVyId());
		}
		if (form.getSatsangDays() != null
				&& !"".equals(form.getSatsangDays().trim())) {
			dto.setSatsangDay(form.getSatsangDays());
		}
		if (form.getSatsangTimeStart() != null
				&& !"".equals(form.getSatsangTimeStart().trim())) {
			dto.setSatsangTimestart(form.getSatsangTimeStart());
		}
		if (form.getSatsangTimeEnd() != null
				&& !"".equals(form.getSatsangTimeEnd().trim())) {
			dto.setSatsangTimeend(form.getSatsangTimeEnd());
		}
		if (form.getRegularityOrOnce() != null
				&& !"".equals(form.getRegularityOrOnce().trim())) {
			dto.setRegularityOrOnce(form.getRegularityOrOnce());
		}

		return dto;

	}

}
